package com.qiyue.common.constant;

/**
 * Created by y747718944 on 2018/1/25
 * 公共常量类
 */
public class CommonConstants {


    /**
     * 尤里卡 服务
     */
    public final  static class EurekaService{

            public final  static String Eureka_ADMIN = "cloud-admin";
    }

    /**
     * 异常常量
     */
    public final static  class ExceptionConstants{
        // 用户token异常

        public static final Integer EX_USER_INVALID_CODE = 40101; //失效
        public static final Integer EX_USER_ERROR_CODE = 40102; //错误
        public static final Integer EX_USER_ISNULL_CODE = 40104; //错误
        // 客户端token异常
        public static final Integer EX_CLIENT_INVALID_CODE = 40301;

        public static final Integer EX_CLIENT_FORBIDDEN_CODE = 40331;
        public static final Integer EX_OTHER_CODE = 500;
    }

    /**
     * 上下文常量
     */
    public  final  static class ContextConstant{

//        当前用户信息
        public static final String CONTEXT_KEY_USER_ID = "currentUserId";
        public static final String CONTEXT_KEY_USER_ACCOUNT = "currentUserAccount";
        public static final String CONTEXT_KEY_USER_NAME = "currentUserName";
        public static final String CONTEXT_KEY_USER_TOKEN = "currentUserToken";
        public static final String CONTEXT_KEY_USER_HOST = "currentUserHost";


    }

    /**
     * 资源常量
     */
    public final static class ResourceConstant{
        public final static String RESOURCE_TYPE_MENU = "menu";
        public final static String RESOURCE_TYPE_BTN = "button";
    }

    /**
     * Json web Token 常量
     */
    public final static class JWTConstant{
        public static final String JWT_KEY_USER_ID = "userId";
        public static final String JWT_KEY_NAME = "name";
    }
}
